package mappers;

import java.sql.PreparedStatement;

import domains.Room;

import managers.DatabaseConnection;

public class RoomMapper {

	public void addRoom(Room r) {

		String sql = "insert into PPKEA.room (RoomName, RoomSize) values (?, ?)";
		try {
			DatabaseConnection dbConnect = new DatabaseConnection();
			PreparedStatement query = dbConnect.getConnect().prepareStatement(
					sql);
			
			query.setString(1, r.getRoomName());
			query.setInt(2, r.getRoomSize());
			query.executeUpdate();

		} catch (Exception e) {
			e.printStackTrace();
		}

	}
}
